/**
 * 管理员菜单相关接口
 */
import { requestData } from '@/utils/request'

const prefix = '/sysMenu'

const baseApi = {
  list(params) {
    return requestData({
      url: `${prefix}/list`,
      method: 'get',
      params
    })
  },
  add(data) {
    return requestData({
      url: `${prefix}/add`,
      method: 'post',
      data
    })
  },
  del(id) {
    return requestData({
      url: `${prefix}/del/${id}`,
      method: 'delete'
    })
  },
  down(id) {
    return requestData({
      url: `${prefix}/down/${id}`,
      method: 'put'
    })
  },
  get(id) {
    return requestData({
      url: `${prefix}/get/${id}`,
      method: 'get'
    })
  },
  getParent(id) {
    return requestData({
      url: `${prefix}/getParent/${id}`,
      method: 'get'
    })
  },
  listMy(type) {
    return requestData({
      url: `${prefix}/listMy/${type}`,
      method: 'get'
    })
  },
  listTree(type) {
    return requestData({
      url: `${prefix}/listTree/${type}`,
      method: 'get'
    })
  },
  setHidden(params) {
    return requestData({
      url: `${prefix}/setHidden`,
      method: 'put',
      params
    })
  },
  up(id) {
    return requestData({
      url: `${prefix}/up/${id}`,
      method: 'put'
    })
  },
  update(data) {
    return requestData({
      url: `${prefix}/update`,
      method: 'put',
      data
    })
  }
}

export default baseApi
